<!DOCTYPE html>
<html>
  <head>
    <title>
      Notification Settings
    </title>
    <link type="text/css" rel="stylesheet" href="/css/forms.css">
  </head>
  <body>
    <div id='settings'>
      <h1>
        Notification Settings
      </h1>
      <h3>
        From here you can view and update your notification settings
      </h3>
      <form action="/settings/update" method='put'>
        <fieldset>
          <legend>Email Address</legend>
          <div class='set_description'>
            Where to send your notifications
          </div>
          <label><input name='email' type='text' id='email' value='{{ email }}'></label>
          <input type='hidden' name='setting' value='email'>
          <input type='submit' name='action' value='Update'>
        </fieldset>
      </form>
      <form action="/settings/update" method='put'>
        <fieldset>
          <legend>Common Searches</legend>
            <div class='set_description'>
              Check these to activate notifications of each type.
            </div>
            <label><input name='common_term' type='checkbox' value="% Off"{% if commonTerms.pct_off %}checked {% endif %}> "% Off" </label>
            <label><input name='common_term' type='checkbox' value="Weekend Deal"{% if commonTerms.wknd_deal %}checked {% endif %}> "Weekend Deal" </label>
            <label><input name='common_term' type='checkbox' value="Sale"{% if commonTerms.sale %}checked {% endif %}> "Sale" </label>
          </legend>
          <input type='hidden' name='setting' value='commonTerms'>
          <input type='submit' name='action' value='Update'>
        </fieldset>
      </form>
      <form action="/settings/update" method='put'>
        <fieldset>
          <legend>Additional Search Criteria</legend>
          <div class='set_description'>
            Below are listed any additional words you would like to look for.
          </div>
          <div class='set_example'>
            Examples: "L4D2" or "Half-Life"
          </div>
          <div class='terms_list'>
            <ul>{% for term in includedTerms %}
                <li>"{{ term }}" <a href='/settings/update?action=delete&setting=includedTerms&term={{ term }}'>delete</a></li>
                {% endfor %}
            </ul>
          </div>
            <label>  
              <input name='include_term' type='text'>
            </label> 
            <input type='hidden' name='setting' value='includedTerms'>
            <input type='submit' name='action' value='Add'>
        </fieldset>
      </form>
      <form action="/settings/update" method='put'>
        <fieldset>
          <legend>Exclusions</legend>
          <div class='set_description'>
            Add any words you want to ignore, even if they match the above search criteria.
          </div>
          <div class='set_example'>
            Examples: "Nancy Drew" would exclude the subject "Nancy Drew 99% Off".
          </div>
          <div class='terms_list'>
            <ul>
              {% for term in excludedTerms %}
                <li>"{{ term }}" <a href='/settings/update?action=delete&setting=excludedTerms&term={{ term }}'>delete</a></li>
              {% endfor %}
            </ul>
          </div>
          <label>  
            <input name='exclude_term' type='text'>
          </label> 
          <input type='hidden' name='setting' value='excludedTerms'>
          <input type='submit' name='action' value='Add'>
        </fieldset>
      </form>
    </div> <!-- div: section_settings -->
  </body>
</html>
